package com.qf.smartdevice.controller;

import com.qf.smartdevice.dot.Result;
import com.qf.smartdevice.pojo.SysMenu;
import com.qf.smartdevice.service.SysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 王博康
 * @version 1.0
 * @project devicemanagementsystem
 * @description: TODO
 * @date 2022/3/28 1:27 星期一
 */
@RestController
@RequestMapping("/menus")
public class SysMenuController {


    private SysMenuService sysMenuService;

    @Autowired
    public void setSysMenuService(SysMenuService sysMenuService) {
        this.sysMenuService = sysMenuService;
    }

    @GetMapping("/menus")
    public Result findAllLeftMenu(){
        List<SysMenu> allLeftMenu = sysMenuService.findAllLeftMenu();
        return Result.setOk(allLeftMenu);

    }
}
